package cn.lxm.samples.auth_server.domain.security;

import java.util.List;

/**
 * @author LXM
 * @Title: oauth2
 * @Description:
 * @date 2018/8/16下午2:57
 */
public class SecurityDetail {


    /**
     * authorities : [{"authority":"memberExport"}]
     * details : {"authorities":[{"authority":"memberExport"}],"details":{"remoteAddress":"192.168.2.13","sessionId":null,"tokenValue":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiJsaXNpIiwic2NvcGUiOlsicmVhZCIsIndyaXRlIl0sInJvbGVzIjpbeyJhdXRob3JpdHkiOiJtZW1iZXJFeHBvcnQifV0sImV4cCI6MTUzNDQwMjUxOCwidXNlck5hbWUiOiJsaXNpIiwiYXV0aG9yaXRpZXMiOlsibWVtYmVyRXhwb3J0Il0sImp0aSI6Ijk0N2JmNmIyLWViOWYtNDk0Mi05ZTdhLTM5ZGRiYTAzNWYwMSIsImNsaWVudF9pZCI6IlVJMiJ9.BVZez7MugYgupd-oqsfOdMpSn7Bud8sea9_22mxCHSTDJ8a6ptva3nJgmy0cRfdA6iYgcixxHicccBFm2kyCJIw1IM4xSvbDQ-sy37uqfcpZO-tbeWcxDhqJLWp5ZscWvkVHvNrzLM37_pTktyfqm3PrD38cnJNojbftn6ic6TDVeGRD2gsD4a389PrZIWZargB1UXYZkzy1baoBsUChVDCMnnxrYzw2gQeC5TTk3y7veq8WK3rS4FGuGKUf_QL3Ky0_B-IkLZZr8shGsj4Aa5EXxz9phUEbf6yXmJaiNJeKe_MIgXktl735d8XG16IpFBnJ7VipWId8Bul6zzql-Q","tokenType":"Bearer","decodedDetails":null},"authenticated":true,"userAuthentication":{"authorities":[{"authority":"memberExport"}],"details":{"remoteAddress":"192.168.2.13","sessionId":"9B37A7565CAB01FBDE8F1D70A32CC38D"},"authenticated":true,"principal":{"password":null,"username":"lisi","authorities":[{"authority":"memberExport"}],"accountNonExpired":true,"accountNonLocked":true,"credentialsNonExpired":true,"enabled":true},"credentials":null,"name":"lisi"},"oauth2Request":{"clientId":"UI2","scope":["read","write"],"requestParameters":{"code":"PTAQPv","grant_type":"authorization_code","response_type":"code","redirect_uri":"http://192.168.2.13:8084/login","state":"Qd2eDA","client_id":"UI2"},"resourceIds":[],"authorities":[],"approved":true,"refresh":false,"redirectUri":"http://192.168.2.13:8084/login","responseTypes":["code"],"extensions":{},"grantType":"authorization_code","refreshTokenRequest":null},"principal":{"password":null,"username":"lisi","authorities":[{"authority":"memberExport"}],"accountNonExpired":true,"accountNonLocked":true,"credentialsNonExpired":true,"enabled":true},"clientOnly":false,"credentials":"","name":"lisi"}
     * authenticated : true
     * principal : lisi
     * credentials : N/A
     * name : lisi
     */

    private DetailsBeanXX details;
    private boolean authenticated;
    private String principal;
    private String credentials;
    private String name;
    private List<AuthoritiesBeanXXXX> authorities;

    public DetailsBeanXX getDetails() {
        return details;
    }

    public void setDetails(DetailsBeanXX details) {
        this.details = details;
    }

    public boolean isAuthenticated() {
        return authenticated;
    }

    public void setAuthenticated(boolean authenticated) {
        this.authenticated = authenticated;
    }

    public String getPrincipal() {
        return principal;
    }

    public void setPrincipal(String principal) {
        this.principal = principal;
    }

    public String getCredentials() {
        return credentials;
    }

    public void setCredentials(String credentials) {
        this.credentials = credentials;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<AuthoritiesBeanXXXX> getAuthorities() {
        return authorities;
    }

    public void setAuthorities(List<AuthoritiesBeanXXXX> authorities) {
        this.authorities = authorities;
    }

    public static class DetailsBeanXX {
        /**
         * authorities : [{"authority":"memberExport"}]
         * details : {"remoteAddress":"192.168.2.13","sessionId":null,"tokenValue":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiJsaXNpIiwic2NvcGUiOlsicmVhZCIsIndyaXRlIl0sInJvbGVzIjpbeyJhdXRob3JpdHkiOiJtZW1iZXJFeHBvcnQifV0sImV4cCI6MTUzNDQwMjUxOCwidXNlck5hbWUiOiJsaXNpIiwiYXV0aG9yaXRpZXMiOlsibWVtYmVyRXhwb3J0Il0sImp0aSI6Ijk0N2JmNmIyLWViOWYtNDk0Mi05ZTdhLTM5ZGRiYTAzNWYwMSIsImNsaWVudF9pZCI6IlVJMiJ9.BVZez7MugYgupd-oqsfOdMpSn7Bud8sea9_22mxCHSTDJ8a6ptva3nJgmy0cRfdA6iYgcixxHicccBFm2kyCJIw1IM4xSvbDQ-sy37uqfcpZO-tbeWcxDhqJLWp5ZscWvkVHvNrzLM37_pTktyfqm3PrD38cnJNojbftn6ic6TDVeGRD2gsD4a389PrZIWZargB1UXYZkzy1baoBsUChVDCMnnxrYzw2gQeC5TTk3y7veq8WK3rS4FGuGKUf_QL3Ky0_B-IkLZZr8shGsj4Aa5EXxz9phUEbf6yXmJaiNJeKe_MIgXktl735d8XG16IpFBnJ7VipWId8Bul6zzql-Q","tokenType":"Bearer","decodedDetails":null}
         * authenticated : true
         * userAuthentication : {"authorities":[{"authority":"memberExport"}],"details":{"remoteAddress":"192.168.2.13","sessionId":"9B37A7565CAB01FBDE8F1D70A32CC38D"},"authenticated":true,"principal":{"password":null,"username":"lisi","authorities":[{"authority":"memberExport"}],"accountNonExpired":true,"accountNonLocked":true,"credentialsNonExpired":true,"enabled":true},"credentials":null,"name":"lisi"}
         * oauth2Request : {"clientId":"UI2","scope":["read","write"],"requestParameters":{"code":"PTAQPv","grant_type":"authorization_code","response_type":"code","redirect_uri":"http://192.168.2.13:8084/login","state":"Qd2eDA","client_id":"UI2"},"resourceIds":[],"authorities":[],"approved":true,"refresh":false,"redirectUri":"http://192.168.2.13:8084/login","responseTypes":["code"],"extensions":{},"grantType":"authorization_code","refreshTokenRequest":null}
         * principal : {"password":null,"username":"lisi","authorities":[{"authority":"memberExport"}],"accountNonExpired":true,"accountNonLocked":true,"credentialsNonExpired":true,"enabled":true}
         * clientOnly : false
         * credentials :
         * name : lisi
         */

        private DetailsBean details;
        private boolean authenticated;
        private UserAuthenticationBean userAuthentication;
        private Oauth2RequestBean oauth2Request;
        private PrincipalBeanX principal;
        private boolean clientOnly;
        private String credentials;
        private String name;
        private List<AuthoritiesBeanXXX> authorities;

        public DetailsBean getDetails() {
            return details;
        }

        public void setDetails(DetailsBean details) {
            this.details = details;
        }

        public boolean isAuthenticated() {
            return authenticated;
        }

        public void setAuthenticated(boolean authenticated) {
            this.authenticated = authenticated;
        }

        public UserAuthenticationBean getUserAuthentication() {
            return userAuthentication;
        }

        public void setUserAuthentication(UserAuthenticationBean userAuthentication) {
            this.userAuthentication = userAuthentication;
        }

        public Oauth2RequestBean getOauth2Request() {
            return oauth2Request;
        }

        public void setOauth2Request(Oauth2RequestBean oauth2Request) {
            this.oauth2Request = oauth2Request;
        }

        public PrincipalBeanX getPrincipal() {
            return principal;
        }

        public void setPrincipal(PrincipalBeanX principal) {
            this.principal = principal;
        }

        public boolean isClientOnly() {
            return clientOnly;
        }

        public void setClientOnly(boolean clientOnly) {
            this.clientOnly = clientOnly;
        }

        public String getCredentials() {
            return credentials;
        }

        public void setCredentials(String credentials) {
            this.credentials = credentials;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public List<AuthoritiesBeanXXX> getAuthorities() {
            return authorities;
        }

        public void setAuthorities(List<AuthoritiesBeanXXX> authorities) {
            this.authorities = authorities;
        }

        public static class DetailsBean {
            /**
             * remoteAddress : 192.168.2.13
             * sessionId : null
             * tokenValue : eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiJsaXNpIiwic2NvcGUiOlsicmVhZCIsIndyaXRlIl0sInJvbGVzIjpbeyJhdXRob3JpdHkiOiJtZW1iZXJFeHBvcnQifV0sImV4cCI6MTUzNDQwMjUxOCwidXNlck5hbWUiOiJsaXNpIiwiYXV0aG9yaXRpZXMiOlsibWVtYmVyRXhwb3J0Il0sImp0aSI6Ijk0N2JmNmIyLWViOWYtNDk0Mi05ZTdhLTM5ZGRiYTAzNWYwMSIsImNsaWVudF9pZCI6IlVJMiJ9.BVZez7MugYgupd-oqsfOdMpSn7Bud8sea9_22mxCHSTDJ8a6ptva3nJgmy0cRfdA6iYgcixxHicccBFm2kyCJIw1IM4xSvbDQ-sy37uqfcpZO-tbeWcxDhqJLWp5ZscWvkVHvNrzLM37_pTktyfqm3PrD38cnJNojbftn6ic6TDVeGRD2gsD4a389PrZIWZargB1UXYZkzy1baoBsUChVDCMnnxrYzw2gQeC5TTk3y7veq8WK3rS4FGuGKUf_QL3Ky0_B-IkLZZr8shGsj4Aa5EXxz9phUEbf6yXmJaiNJeKe_MIgXktl735d8XG16IpFBnJ7VipWId8Bul6zzql-Q
             * tokenType : Bearer
             * decodedDetails : null
             */

            private String remoteAddress;
            private Object sessionId;
            private String tokenValue;
            private String tokenType;
            private Object decodedDetails;

            public String getRemoteAddress() {
                return remoteAddress;
            }

            public void setRemoteAddress(String remoteAddress) {
                this.remoteAddress = remoteAddress;
            }

            public Object getSessionId() {
                return sessionId;
            }

            public void setSessionId(Object sessionId) {
                this.sessionId = sessionId;
            }

            public String getTokenValue() {
                return tokenValue;
            }

            public void setTokenValue(String tokenValue) {
                this.tokenValue = tokenValue;
            }

            public String getTokenType() {
                return tokenType;
            }

            public void setTokenType(String tokenType) {
                this.tokenType = tokenType;
            }

            public Object getDecodedDetails() {
                return decodedDetails;
            }

            public void setDecodedDetails(Object decodedDetails) {
                this.decodedDetails = decodedDetails;
            }
        }

        public static class UserAuthenticationBean {
            /**
             * authorities : [{"authority":"memberExport"}]
             * details : {"remoteAddress":"192.168.2.13","sessionId":"9B37A7565CAB01FBDE8F1D70A32CC38D"}
             * authenticated : true
             * principal : {"password":null,"username":"lisi","authorities":[{"authority":"memberExport"}],"accountNonExpired":true,"accountNonLocked":true,"credentialsNonExpired":true,"enabled":true}
             * credentials : null
             * name : lisi
             */

            private DetailsBeanX details;
            private boolean authenticated;
            private PrincipalBean principal;
            private Object credentials;
            private String name;
            private List<AuthoritiesBeanX> authorities;

            public DetailsBeanX getDetails() {
                return details;
            }

            public void setDetails(DetailsBeanX details) {
                this.details = details;
            }

            public boolean isAuthenticated() {
                return authenticated;
            }

            public void setAuthenticated(boolean authenticated) {
                this.authenticated = authenticated;
            }

            public PrincipalBean getPrincipal() {
                return principal;
            }

            public void setPrincipal(PrincipalBean principal) {
                this.principal = principal;
            }

            public Object getCredentials() {
                return credentials;
            }

            public void setCredentials(Object credentials) {
                this.credentials = credentials;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public List<AuthoritiesBeanX> getAuthorities() {
                return authorities;
            }

            public void setAuthorities(List<AuthoritiesBeanX> authorities) {
                this.authorities = authorities;
            }

            public static class DetailsBeanX {
                /**
                 * remoteAddress : 192.168.2.13
                 * sessionId : 9B37A7565CAB01FBDE8F1D70A32CC38D
                 */

                private String remoteAddress;
                private String sessionId;

                public String getRemoteAddress() {
                    return remoteAddress;
                }

                public void setRemoteAddress(String remoteAddress) {
                    this.remoteAddress = remoteAddress;
                }

                public String getSessionId() {
                    return sessionId;
                }

                public void setSessionId(String sessionId) {
                    this.sessionId = sessionId;
                }
            }

            public static class PrincipalBean {
                /**
                 * password : null
                 * username : lisi
                 * authorities : [{"authority":"memberExport"}]
                 * accountNonExpired : true
                 * accountNonLocked : true
                 * credentialsNonExpired : true
                 * enabled : true
                 */

                private Object password;
                private String username;
                private boolean accountNonExpired;
                private boolean accountNonLocked;
                private boolean credentialsNonExpired;
                private boolean enabled;
                private List<AuthoritiesBean> authorities;

                public Object getPassword() {
                    return password;
                }

                public void setPassword(Object password) {
                    this.password = password;
                }

                public String getUsername() {
                    return username;
                }

                public void setUsername(String username) {
                    this.username = username;
                }

                public boolean isAccountNonExpired() {
                    return accountNonExpired;
                }

                public void setAccountNonExpired(boolean accountNonExpired) {
                    this.accountNonExpired = accountNonExpired;
                }

                public boolean isAccountNonLocked() {
                    return accountNonLocked;
                }

                public void setAccountNonLocked(boolean accountNonLocked) {
                    this.accountNonLocked = accountNonLocked;
                }

                public boolean isCredentialsNonExpired() {
                    return credentialsNonExpired;
                }

                public void setCredentialsNonExpired(boolean credentialsNonExpired) {
                    this.credentialsNonExpired = credentialsNonExpired;
                }

                public boolean isEnabled() {
                    return enabled;
                }

                public void setEnabled(boolean enabled) {
                    this.enabled = enabled;
                }

                public List<AuthoritiesBean> getAuthorities() {
                    return authorities;
                }

                public void setAuthorities(List<AuthoritiesBean> authorities) {
                    this.authorities = authorities;
                }

                public static class AuthoritiesBean {
                    /**
                     * authority : memberExport
                     */

                    private String authority;

                    public String getAuthority() {
                        return authority;
                    }

                    public void setAuthority(String authority) {
                        this.authority = authority;
                    }
                }
            }

            public static class AuthoritiesBeanX {
                /**
                 * authority : memberExport
                 */

                private String authority;

                public String getAuthority() {
                    return authority;
                }

                public void setAuthority(String authority) {
                    this.authority = authority;
                }
            }
        }

        public static class Oauth2RequestBean {
            /**
             * clientId : UI2
             * scope : ["read","write"]
             * requestParameters : {"code":"PTAQPv","grant_type":"authorization_code","response_type":"code","redirect_uri":"http://192.168.2.13:8084/login","state":"Qd2eDA","client_id":"UI2"}
             * resourceIds : []
             * authorities : []
             * approved : true
             * refresh : false
             * redirectUri : http://192.168.2.13:8084/login
             * responseTypes : ["code"]
             * extensions : {}
             * grantType : authorization_code
             * refreshTokenRequest : null
             */

            private String clientId;
            private RequestParametersBean requestParameters;
            private boolean approved;
            private boolean refresh;
            private String redirectUri;
            private ExtensionsBean extensions;
            private String grantType;
            private Object refreshTokenRequest;
            private List<String> scope;
            private List<?> resourceIds;
            private List<?> authorities;
            private List<String> responseTypes;

            public String getClientId() {
                return clientId;
            }

            public void setClientId(String clientId) {
                this.clientId = clientId;
            }

            public RequestParametersBean getRequestParameters() {
                return requestParameters;
            }

            public void setRequestParameters(RequestParametersBean requestParameters) {
                this.requestParameters = requestParameters;
            }

            public boolean isApproved() {
                return approved;
            }

            public void setApproved(boolean approved) {
                this.approved = approved;
            }

            public boolean isRefresh() {
                return refresh;
            }

            public void setRefresh(boolean refresh) {
                this.refresh = refresh;
            }

            public String getRedirectUri() {
                return redirectUri;
            }

            public void setRedirectUri(String redirectUri) {
                this.redirectUri = redirectUri;
            }

            public ExtensionsBean getExtensions() {
                return extensions;
            }

            public void setExtensions(ExtensionsBean extensions) {
                this.extensions = extensions;
            }

            public String getGrantType() {
                return grantType;
            }

            public void setGrantType(String grantType) {
                this.grantType = grantType;
            }

            public Object getRefreshTokenRequest() {
                return refreshTokenRequest;
            }

            public void setRefreshTokenRequest(Object refreshTokenRequest) {
                this.refreshTokenRequest = refreshTokenRequest;
            }

            public List<String> getScope() {
                return scope;
            }

            public void setScope(List<String> scope) {
                this.scope = scope;
            }

            public List<?> getResourceIds() {
                return resourceIds;
            }

            public void setResourceIds(List<?> resourceIds) {
                this.resourceIds = resourceIds;
            }

            public List<?> getAuthorities() {
                return authorities;
            }

            public void setAuthorities(List<?> authorities) {
                this.authorities = authorities;
            }

            public List<String> getResponseTypes() {
                return responseTypes;
            }

            public void setResponseTypes(List<String> responseTypes) {
                this.responseTypes = responseTypes;
            }

            public static class RequestParametersBean {
            }

            public static class ExtensionsBean {
            }
        }

        public static class PrincipalBeanX {
            /**
             * password : null
             * username : lisi
             * authorities : [{"authority":"memberExport"}]
             * accountNonExpired : true
             * accountNonLocked : true
             * credentialsNonExpired : true
             * enabled : true
             */

            private Object password;
            private String username;
            private boolean accountNonExpired;
            private boolean accountNonLocked;
            private boolean credentialsNonExpired;
            private boolean enabled;
            private List<AuthoritiesBeanXX> authorities;

            public Object getPassword() {
                return password;
            }

            public void setPassword(Object password) {
                this.password = password;
            }

            public String getUsername() {
                return username;
            }

            public void setUsername(String username) {
                this.username = username;
            }

            public boolean isAccountNonExpired() {
                return accountNonExpired;
            }

            public void setAccountNonExpired(boolean accountNonExpired) {
                this.accountNonExpired = accountNonExpired;
            }

            public boolean isAccountNonLocked() {
                return accountNonLocked;
            }

            public void setAccountNonLocked(boolean accountNonLocked) {
                this.accountNonLocked = accountNonLocked;
            }

            public boolean isCredentialsNonExpired() {
                return credentialsNonExpired;
            }

            public void setCredentialsNonExpired(boolean credentialsNonExpired) {
                this.credentialsNonExpired = credentialsNonExpired;
            }

            public boolean isEnabled() {
                return enabled;
            }

            public void setEnabled(boolean enabled) {
                this.enabled = enabled;
            }

            public List<AuthoritiesBeanXX> getAuthorities() {
                return authorities;
            }

            public void setAuthorities(List<AuthoritiesBeanXX> authorities) {
                this.authorities = authorities;
            }

            public static class AuthoritiesBeanXX {
                /**
                 * authority : memberExport
                 */

                private String authority;

                public String getAuthority() {
                    return authority;
                }

                public void setAuthority(String authority) {
                    this.authority = authority;
                }
            }
        }

        public static class AuthoritiesBeanXXX {
            /**
             * authority : memberExport
             */

            private String authority;

            public String getAuthority() {
                return authority;
            }

            public void setAuthority(String authority) {
                this.authority = authority;
            }
        }
    }

    public static class AuthoritiesBeanXXXX {
        /**
         * authority : memberExport
         */

        private String authority;

        public String getAuthority() {
            return authority;
        }

        public void setAuthority(String authority) {
            this.authority = authority;
        }
    }
}
